package com.thomas.es;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;

import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.transport.client.PreBuiltTransportClient;

/**   
* @Description: TODO(用一句话描述该文件做什么) 
* @author thomas_liu  
* @date 2018年6月13日 下午7:31:22 
* @version V1.0   
*/
public class Test {
	
	private static String host ="192.168.198.201";//服务器地址
	private static int port = 9300;//端口
	
	public static void main(String[] args) throws UnknownHostException {
		TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
				.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(Test.host), Test.port));
		System.out.println(client);
		client.close();
		
	}
	
	
	
}
